<div id="read_activities"></div>
<script type="text/javascript">

function <? echo $data_response->getJSFunction()->getName() ?>(<? echo $data_response->getJSFunction()->getArgs() ?>) 
{
  var htmlout= '';
  <?php echo $data_response->getData($viewerActivities); ?>
  <?php echo $data_response->getData($friendActivities); ?>
  <?php $activity = new OSActivity('activity'); ?>
  
  <?php echo $viewerActivities->getActivitiesStreamVarName()?>.each(function(<?php echo $activity->getActivityVarName() ?>) {
    var body = <?php echo $activity->getField(OSActivityField::BODY); ?>
    htmlout += '<br>'+ body +'</br>'; 
  });
  htmlout += '------';
  <?php echo $friendActivities->getActivitiesStreamVarName()?>.each(function(<?php echo $activity->getActivityVarName() ?>) {
    var body = <?php echo $activity->getField(OSActivityField::BODY); ?>
    htmlout += '<br>'+ body +'</br>'; 
  });
  document.getElementById('read_activities').innerHTML = htmlout;
  
}
</script>
